package com.gz.thread.runnable;

public class Yield {
    public static void main(String[] args) {
        MyYield yield = new MyYield();
        new Thread(yield,"a").start();
        new Thread(yield,"b").start();
    }
}

class MyYield implements Runnable{

    public void run() {
        System.out.println(Thread.currentThread().getName()+",开始执行。。。。。");
        Thread.yield();
        System.out.println(Thread.currentThread().getName()+",结束执行。。。。。");
    }
}
